package com.ruoyi.common.mq;

import org.springframework.stereotype.Component;
import org.zeromq.ZMQ;
import org.springframework.stereotype.Service;

@Component
public class ZeroMqSender {

    public void sendMessage(String message) {
        ZMQ.Context context = ZMQ.context(1);
        ZMQ.Socket socket = context.socket(ZMQ.PUSH);
        socket.connect("tcp://localhost:5555");
        socket.send(message.getBytes(), 0);
        socket.close();
        context.term();
    }
}
